package spring;

/**
 * @ProjectName: Spring
 * @Package: spring
 * @ClassName: AnnotationConfigApplicationContext
 * @Author: zxh
 * @Description: 用于注解式编程
 * @Date: 2022/3/10 13:54
 * @Version: 1.0
 */
public class AnnotationConfigApplicationContext extends AbstractApplicationContext{

    private final AnnotatedBeanDefinitionReader reader;

    public AnnotationConfigApplicationContext() {
        this.reader = new AnnotatedBeanDefinitionReader(register);
    }

    public AnnotationConfigApplicationContext(Class componentClasses){
        this();
        register(componentClasses);
        refresh();
    }

    public void register(Class componentClasses) {
        this.reader.register(componentClasses);
    }

}
